home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / chown.man < prev    next >
Encoding:
Text File  |  1990-10-18  |  3.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. CHOWN                 C Library Procedures                  CHOWN
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      chown, fchown - change owner and group of a file
  10.  
  11. SSYYNNOOPPSSIISS
  12.      cchhoowwnn((ppaatthh,, oowwnneerr,, ggrroouupp))
  13.      cchhaarr **ppaatthh;;
  14.      iinntt oowwnneerr,, ggrroouupp;;
  15.  
  16.      ffcchhoowwnn((ffdd,, oowwnneerr,, ggrroouupp))
  17.      iinntt ffdd,, oowwnneerr,, ggrroouupp;;
  18.  
  19. DDEESSCCRRIIPPTTIIOONN
  20.      The file that is named by _p_a_t_h or referenced by _f_d has its
  21.      _o_w_n_e_r and _g_r_o_u_p changed as specified.  Only the super-user
  22.      may change the owner of the file, because if users were able
  23.      to give files away, they could defeat the file-space
  24.      accounting procedures.  The owner of the file may change the
  25.      group to a group of which he is a member.
  26.  
  27.      On some systems, _c_h_o_w_n clears the set-user-id and set-
  28.      group-id bits on the file to prevent accidental creation of
  29.      set-user-id and set-group-id programs.
  30.  
  31.      _F_c_h_o_w_n is particularly useful when used in conjunction with
  32.      the file locking primitives (see _f_l_o_c_k(2)).
  33.  
  34.      One of the owner or group id's may be left unchanged by
  35.      specifying it as -1.
  36.  
  37.      If the final component of _p_a_t_h is a symbolic link, the own-
  38.      ership and group of the symbolic link is changed, not the
  39.      ownership and group of the file or directory to which it
  40.      points.
  41.  
  42. RREETTUURRNN VVAALLUUEE
  43.      Zero is returned if the operation was successful; -1 is
  44.      returned if an error occurs, with a more specific error code
  45.      being placed in the global variable _e_r_r_n_o.
  46.  
  47. EERRRROORRSS
  48.      _C_h_o_w_n will fail and the file will be unchanged if:
  49.  
  50.      [ENOTDIR]      A component of the path prefix is not a
  51.                     directory.
  52.  
  53.      [EINVAL]       The pathname contains a character with the
  54.                     high-order bit set.
  55.  
  56.      [ENAMETOOLONG] A component of a pathname exceeded 255 char-
  57.                     acters, or an entire path name exceeded 1023
  58.                     characters.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CHOWN                 C Library Procedures                  CHOWN
  71.  
  72.  
  73.  
  74.      [ENOENT]       The named file does not exist.
  75.  
  76.      [EACCES]       Search permission is denied for a component
  77.                     of the path prefix.
  78.  
  79.      [ELOOP]        Too many symbolic links were encountered in
  80.                     translating the pathname.
  81.  
  82.      [EPERM]        The effective user ID is not the super-user.
  83.  
  84.      [EROFS]        The named file resides on a read-only file
  85.                     system.
  86.  
  87.      [EFAULT]       _P_a_t_h points outside the process's allocated
  88.                     address space.
  89.  
  90.      [EIO]          An I/O error occurred while reading from or
  91.                     writing to the file system.
  92.  
  93.      _F_c_h_o_w_n will fail if:
  94.  
  95.      [EBADF]        _F_d does not refer to a valid descriptor.
  96.  
  97.      [EINVAL]       _F_d refers to a socket, not a file.
  98.  
  99.      [EPERM]        The effective user ID is not the super-user.
  100.  
  101.      [EROFS]        The named file resides on a read-only file
  102.                     system.
  103.  
  104.      [EIO]          An I/O error occurred while reading from or
  105.                     writing to the file system.
  106.  
  107. SSEEEE AALLSSOO
  108.      chown(8), chgrp(1), chmod(2), flock(2)
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.